<!-- Begin one column window -->
<div class="onecolumn">
    <div class="header">
        <span style="font-weight: bold; text-align: center; color: red;">Danh sách bạn đọc</span>
    </div>
    <br class="clear"/>
    <div class="content">
        <form id="form_data" name="form_data" action="" method="post">
            <div id="list-reader">
                <p>
                    <label>Bộ lọc:</label>
                    <select style="width: 180px;padding: 9px;">
                        <option>Hiển thị toàn bộ</option>
                        <option>Hiển thị theo khóa học</option>
                        <option>Hiển thị theo khoa</option>
                    </select>
                </p>
                <p>
                    <input type="text" id="input-info" placeholder="Nhập giá trị tương ứng">
                </p>
                <p>
                    <input type="submit" value="Hiển thị">
                </p>
            </div>
            <p style="float: right;">
                <input type="submit" value="In báo cáo">
            </p>
            <p style="float: right;margin-right: 10px;">
                <input type="submit" value="Xóa">
            </p>
            <br class="clear">
            <table class="data" width="100%" cellpadding="0" cellspacing="0">
                <thead>
                    <tr>
                        <th style="width:10px">
                            <input type="checkbox" id="check_all" name="check_all"/>
                        </th>
                        <th style="width:10%">Mã thẻ</th>
                        <th style="width:20%">Họ tên</th>
                        <th style="width:15%">Đơn vị</th>
                        <th style="width:12%">Ngày cấp</th>
                        <th style="width:12%">Ngày hết hạn</th>
                        <th style="width:15%">Tình trạng lưu thông</th>
                        <th style="width:16%">Thao tác</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($paginator as $reader) : ?>
                        <tr>
                            <td><input type="checkbox"></td>
                            <td><?php echo $this->escapeHtml($reader->cardBarcode); ?></td>
                            <td>
                                <?php
                                $cardBarcode = str_replace('.', '-', $reader->cardBarcode);
                                ?>
                                <a href="<?php echo $this->url('list-reader/default', array('action' => 'detailReader', 'id' => $cardBarcode)) ?>">
                                    <?php echo $this->escapeHtml($reader->fullName); ?>
                                </a>
                            </td>
                            <td><?php echo $this->escapeHtml($reader->className) . ' -' . $this->escapeHtml($reader->facultyName); ?></td>
                            <td>
                                <?php
                                $dateCreated = explode('-', $reader->dateCreated);
                                echo $this->escapeHtml($dateCreated[2] . '-' . $dateCreated[1] . '-' . $dateCreated[0]);
                                ?>
                            </td>
                            <td>
                                <?php
                                $dateExpiry = explode('-', $reader->dateExpiry);
                                echo $this->escapeHtml($dateExpiry[2] . '-' . $dateExpiry[1] . '-' . $dateExpiry[0]);
                                ?>
                            </td>
                            <td>
                                <?php if ($reader->isActive): ?>
                                    <a href="" style="margin-left: 30px"><img src=<?php echo $this->basePath() . '/img/icon_accept.png' ?> alt="delete" class="help" title="Ngừng lưu thông"/></a>
                                <?php else: ?>
                                    <a href=""style="margin-left: 30px"><img src=<?php echo $this->basePath() . '/img/icon_delete.png' ?> alt="edit" class="help" title="Lưu thông"/></a>
                                <?php endif; ?>
                            </td>
                            <td>
                                <a href=""><img src=<?php echo $this->basePath() . '/img/add.png' ?> alt="edit" class="help" title="Gia hạn"/></a>
                                <a href="<?php echo $this->url('add-new-reader/default', array('action' => 'editReader', 'id' => $reader->userID)) ?>" style="margin-left: 20px;"><img src=<?php echo $this->basePath() . '/img/icon_edit.png' ?> alt="edit" class="help" title="Chỉnh sửa"/></a>
                                <a href="" style="margin-left: 20px;"><img src=<?php echo $this->basePath() . '/img/delete.png' ?> alt="Xóa" class="help" title="Xóa"/></a>
                            </td>
                        </tr>
                    <?php endforeach; ?>
                </tbody>
            </table>
            <?php
            // add at the end of the file after the table
            echo $this->paginationControl(
                    // the paginator object
                    $this->paginator,
                    // the scrolling style; see http://zf2.readthedocs.org/en/release-2.1.4/modules/zend.paginator.usage.html#rendering-pages-with-view-scripts
                    'sliding',
                    // the partial to use to render the control
                    array('partial/paginator.phtml', 'Admin'),
                    // the route to link to when a user clicks a control link
                    array(
                'route' => 'list-reader'
                    )
            );
            ?>
        </form>

    </div>
</div>
<!-- End one column window -->